#!/usr/bin/env php
<?

define(CREOVEL_PATH, dirname(dirname(__FILE__))."/vendor/creovel/");

echo "Freezing Creovel to the Newest Version, Please Wait...\n";

// Remove Old and Check Out Newest Version
echo "\tRemoving Old Version\n";
exec("rm -Rfv ".CREOVEL_PATH);

echo "\tInstalling New Version...\n";
exec("/usr/bin/env svn export http://creovel.googlecode.com/svn/trunk/vendor/creovel/ ".CREOVEL_PATH)."\n";
exec("/usr/bin/env svn export http://creovel.googlecode.com/svn/trunk/public/dispatch.php public/dispatch.php --force")."\n";
exec("/usr/bin/env svn export http://creovel.googlecode.com/svn/trunk/config/environment.php config/environment.new.php --force")."\n";

echo "\tRemoving Old Scripts\n";
exec('rm -Rfv script/document');
exec('rm -Rfv script/freeze');
exec('rm -Rfv script/generate');
exec('rm -Rfv script/migrate');
exec('rm -Rfv script/phoenix');

echo "\tInstalling New Scripts\n";
exec("/usr/bin/env svn export http://creovel.googlecode.com/svn/trunk/script/document script/document --force")."\n";
exec("/usr/bin/env svn export http://creovel.googlecode.com/svn/trunk/script/freeze script/freeze --force")."\n";
exec("/usr/bin/env svn export http://creovel.googlecode.com/svn/trunk/script/generate script/generate --force")."\n";
exec("/usr/bin/env svn export http://creovel.googlecode.com/svn/trunk/script/migrate script/migrate --force")."\n";
exec("/usr/bin/env svn export http://creovel.googlecode.com/svn/trunk/script/phoenix script/phoenix --force")."\n";

echo "Creovel Successfully Updated!\n";

?>
